/** 
* <p>Title: FiledHandler.java</p> 
* <p>Description: </p> 
* <p>Copyright: Copyright (c) 2012</p> 
* <p>Company: hnii</p> 
* @author LiuC
* @date 2012-9-16 
* @version 1.0 
*/ 
package com.powerManager.sdk.handlers;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.powerManager.sdk.common.PagingResult;

/** 
 * <p>Title: FiledHandler</p> 
 * <p>Description: 字段权限处理类</p> 
 * <p>Company: hnii</p> 
 * @author    LiuC
 * @date      2012-9-16 
 */
public class FiledHandler {
	
	/** 
	* <p>Title: getConfiguraList</p> 
	* <p>Description: 返回字段配置列表json</p> 
	* @param request
	* @param response
	* @return 
	*/ 
	public String getConfiguraList(HttpServletRequest request, HttpServletResponse response){
		String page = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		StringBuffer sql = new StringBuffer(
				"SELECT configId, t_view, t_grid, t_search, t_from FROM sys_configuration");
		PagingResult pr = new PagingResult(sql.toString());
		String json = null;
		try {
			json = pr.pagingToJson(Integer.parseInt(pageSize), Integer.parseInt(page));
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.println("字段配置列表json："+json);
		return "text:"+json;
	}
}
